<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        table tr:nth-child(odd) {
            background: green;
        }

        /*设置偶数行颜色*/
        table tr:nth-child(even) {
            background: red;
        }

        /*设置鼠标聚焦到行上是凸显*/
        table tr:hover {
            background-color: gold;
        }
    </style>
</head>
<body>
<div align="center">
    <h1>房屋信息查询</h1>
    <a th:href="@{'/house/toadd'}">发布房源</a>
    <table border="2px" cellspacing="2px" cellpadding="2px">
        <tr>
            <td>序号</td>
            <td>描述</td>
            <td>户型</td>
            <td>租金</td>
            <td>发布时间</td>
            <td colspan="2">操作</td>
        </tr>

        <tr th:each="pageInfo:${pageInfo.getList()}">
            <td th:text="${pageInfo.houseid}"></td>
            <td th:text="${pageInfo.housedesc}"></td>
            <td><a th:href="${typeid}" name="typeid"></a></td>
            <td th:text="${pageInfo.monthlyrent}"></td>
            <td th:text="${#dates.format(pageInfo.publishdate,'yyyy-MM-dd ')}"></td>
            <td>
                <button onclick="update()">修改</button>
                <button onclick="del(houseid)">删除</button>
            </td>
        </tr>
    </table>
    <a th:href="@{/house/select(pageInfo.pageNo=1)}">首页</a>&nbsp&nbsp<a th:href="@{/house/select(pageInfo.prePage)}">上一页</a>&nbsp&nbsp
    <a th:href="@{/house/select(pageInfo.nextPage)}">下一页</a>&nbsp&nbsp<a th:href="@{/house/select(pageInfo.last)}">末页</a>&nbsp&nbsp
    第<span th:text="${pageInfo.pageNum}"></span>页/共<span th:text="${pageInfo.pages}"></span>页
</div>
</body>
</html>